home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Cool Demos, SDKs, & Tools / Demos⁄Tools⁄Offers / Eiffel for CW beta 3 / EiffelS2 / LIBRARY / MOTEL / Dialogs.c < prev    next >
Text File  |  1999-04-26  |  2KB  |  83 lines

  1. /*------------------------------------------------------------------*/
  2. /* Eiffel/S II MacOS Runtime                                         */
  3. /*------------------------------------------------------------------*/
  4. /* Author    : Ian Joyner                                               */
  5. /* Release   : 1.0                                                  */
  6. /* Date      : Dec. 1997                                            */
  7. /* Copyright : Ian Joyner                                            */
  8. /*------------------------------------------------------------------*/
  9. /********************************************************************/
  10. /*                                                                    */
  11. /*                                DIALOGs                                */
  12. /*                                                                    */
  13. /********************************************************************/
  14.  
  15. #include <Dialogs.h>
  16. #include <Eiffel2.h>
  17.  
  18. INTEGER platform_dialog_port_size ()
  19. {
  20.     DialogRecord p;
  21.     
  22.     return (sizeof (p));
  23. }
  24.  
  25. POINTER platform_NewDialog (void *wStorage, const Rect *boundsRect,
  26.                          ConstStr255Param title, Boolean visible,
  27.                          INTEGER procID, WindowPtr behind,
  28.                          Boolean goAwayFlag, INTEGER refCon, Handle items)    
  29. {
  30.     DialogPtr dp;
  31.     Str255 scratch;
  32.     
  33.     strcpy (scratch, title);
  34.     c2pstr ((char *)scratch); /* This might not be right if string is loaded from a resource */
  35.     
  36.     dp = NewColorDialog (wStorage, boundsRect, scratch, visible, procID, behind,
  37.                          goAwayFlag, refCon, items);
  38.     return (POINTER) dp;
  39. }
  40.  
  41. POINTER platform_GetNewDialog (INTEGER dialogID, void *dStorage,  WindowPtr behind)
  42. {
  43.     DialogPtr dp;
  44.     
  45.     dp = GetNewDialog (dialogID, dStorage, behind);
  46.     return (POINTER) dp;
  47. }
  48.  
  49. INTEGER platform_ModalDialog ()
  50. {
  51.     INTEGER16 itemHit;
  52.     
  53.     ModalDialog (NULL, &itemHit);
  54.     return itemHit;
  55. }
  56.  
  57. /********************************************************************/
  58. /*                                                                    */
  59. /*                                ALERTs                                */
  60. /*                                                                    */
  61. /********************************************************************/
  62.  
  63. INTEGER platform_alert (int id)
  64. {
  65.     return (Alert (id, NULL));
  66. }
  67.  
  68. INTEGER platform_caution_alert (int id)
  69. {
  70.     return (CautionAlert (id, NULL));
  71. }
  72.  
  73. INTEGER platform_note_alert (int id)
  74. {
  75.     return (NoteAlert (id, NULL));
  76. }
  77.  
  78. INTEGER platform_stop_alert (int id)
  79. {
  80.     return (StopAlert (id, NULL));
  81. }
  82.  
  83.